Many desktop and server computer systems utilize a basic input/output system (“BIOS”) to control various aspects of the computer system. In particular, the BIOS is utilized to perform a power on self-test, to initialize the various hardware components within the computer system, to provide an interface between an operating system executing on the computer system and the hardware, and to perform various other functions.
In many computer systems, the BIOS is stored in an electrically erasable and programmable read only memory (“EEPROM”) device, also referred to herein as a “flash memory device” or a “flash part.” Because flash memory devices may be programmed while actually installed in a computer system, a computer BIOS stored in such a device may be upgraded without removing the flash part from the computer system. This is very convenient for both end users and system administrators.
In order to upgrade or restore the contents of the BIOS EEPROM, a BIOS update utility application may be executed on the computer system. The BIOS update utility utilizes the contents of a BIOS image file, usually stored on disk or available through a network, to update the contents of the BIOS EEPROM. In order to perform this function, the BIOS update utility works in conjunction with a BIOS recovery program stored in the BIOS. The BIOS recovery program contains program code for performing the actual update of the BIOS EEPROM. Because the recovery program is a BIOS program and must be operating system independent, after the system has booted the Operation System, it executes in System Management Mode (“SMM”) when executing on computer systems utilizing some processors available from INTEL CORPORATION or AMD or similar. The BIOS update utility and the recovery program work together to update the contents of the BIOS.
In order for the BIOS update utility and the recovery program to communicate with one another, it is typically necessary to create a device driver. A device driver is needed because the BIOS recovery program executes in the SMM mode and therefore cannot access the virtual memory addresses utilized by most modern computer operating systems and the BIOS update utility application. However, the creation and use of such device drivers can be time consuming and problematic. For instance, a device driver must be created for each of the operating systems on which the BIOS update utility is to be executed. Moreover, when utilized in conjunction with the LINUX operating system or the FREE BSD operating system developed by the University of California, Berkeley, the device driver must be recompiled for each distribution and version of the operating system. This may include the tedious and time consuming process of maintaining many different versions of the device driver for each distribution and version of the operating system.
One method for enabling communication between an application program and a BIOS program executing in SMM mode without the use of a device driver is through the use of a shared memory buffer locked into physical memory. For instance, in order to update the contents of the BIOS, the update utility may copy blocks of the BIOS image file into the shared memory buffer. The BIOS recovery program may then access the memory buffer, read its contents, and write the contents of the memory buffer to the EEPROM. This process may then be repeated until each block has been copied. However, because the BIOS update utility is an application program, it must utilize virtual memory addresses to reference an allocated memory buffer. Because the BIOS recovery program executes in SMM mode, it must utilize physical memory addresses to reference the memory buffer. The BIOS update utility must therefore determine the physical memory address of the buffer and pass this address to the BIOS recovery program. However, until now it has been impossible for a management application program, such as a BIOS update utility, to determine the physical memory address of an allocated memory buffer.
It is with respect to these considerations and others that the present invention has been made.